#include "../func.h"

int main()
{
    sigset_t mask,pend;
    sigemptyset(&mask);
    sigaddset(&mask, SIGINT);
    int ret;
    ret = sigprocmask(SIG_BLOCK, &mask, NULL);
    if (-1 == ret)
    {
        perror("sigprocmask");
        return -1;
    }
    printf("I want to sleep\n");
    sleep(10);
    printf("I am wake up\n");
    sigemptyset(&pend);
    sigpending(&pend);
    if (sigismember(&pend, SIGINT))
    {
        printf("SIGINT is pending\n");
    }
    else
    {
        printf("SIGINT is not pending\n");
    }
    ret = sigprocmask(SIG_UNBLOCK, &mask, NULL);
    if (-1 == ret)
    {
        perror("sigprocmask1");
        return -1;
    }

    return 0;
}
